# rayframe
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)

PROJECT(RayFrame)

#SET(CMAKE_VERBOSE_MAKEFILE true)
SET(GLOBAL_ROOT ${PROJECT_SOURCE_DIR})
SET(GLOBAL_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)

INCLUDE_DIRECTORIES(${GLOBAL_ROOT}/Dependencies/Include)
INCLUDE_DIRECTORIES(${GLOBAL_ROOT}/src/Framework)
LINK_DIRECTORIES(${launcher_SOURCE_DIR}/../../Dependencies/Lib)

# OS detection
IF(UNIX)
  MESSAGE("Building in Linux like system")
  ADD_DEFINITIONS(-DLINUX)
ENDIF()

IF(WIN32)
  MESSAGE("Building in windows")
  ADD_DEFINITIONS(-DWIN32 -D_WINDOWS)
ENDIF()

IF(APPLE)
  ERROR("Apple is not supported right now")
ENDIF()

#Compiler settings
IF(CMAKE_COMPILER_IS_GNUCXX)
  set(CMAKE_CXX_FLAGS "-g -Wall")
ENDIF(CMAKE_COMPILER_IS_GNUCXX)

# disable some warnings for visual studio
IF(CMAKE_BUILD_TOOL MATCHES "(msdev|devenv|nmake)")
    ADD_DEFINITIONS(/wd4819 /wd4996)
ENDIF()

# Force to use warning level 3
if(MSVC)
  # Force to always compile with W4
  if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
    string(REGEX REPLACE "/W[0-4]" "/W3"
      CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
  else()
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3")
  endif()
elseif(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
  # Update if necessary
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-long-long")
endif()

ADD_SUBDIRECTORY(src/Framework)
ADD_SUBDIRECTORY(src/Launcher)
ADD_SUBDIRECTORY(demos)
ADD_SUBDIRECTORY(test)